<?php declare(strict_types=1);

require_once '/data/wwwroot/package/vendor/autoload.php';

use PHPUnit\Framework\TestCase;
use practice\designPatterns\Circle;
use practice\designPatterns\CreationalPatternSimpleFactory;
use practice\designPatterns\Rectangle;
use practice\designPatterns\Shape;
use practice\designPatterns\Square;

final class CreationalPatternSimpleFactoryTest extends TestCase
{
    public function testCanCreateCircle(): void
    {
        $factory = CreationalPatternSimpleFactory::test();
        $this->assertInstanceOf(Shape::class, $factory->getShare('circle'));
        $this->assertInstanceOf(Circle::class, $factory->getShare('circle'));
    }

    public function testCanCreateRectangle(): void
    {
        $factory = CreationalPatternSimpleFactory::test();
        $this->assertInstanceOf(Shape::class, $factory->getShare('Rectangle'));
        $this->assertInstanceOf(Rectangle::class, $factory->getShare('Rectangle'));
    }

    public function testCanCreateSquare(): void
    {
        $factory = CreationalPatternSimpleFactory::test();
        $this->assertInstanceOf(Shape::class, $factory->getShare('Square'));
        $this->assertInstanceOf(Square::class, $factory->getShare('Square'));
    }
}